import 'package:assistant_zhao/freight_smart_login_page.dart';
import 'package:flutter/material.dart';

class SettingPage extends StatefulWidget {
  @override
  State<SettingPage> createState() => _SettingPageState();
}

class _SettingPageState extends State<SettingPage> {
  @override
  Widget build(BuildContext context) {
    return Column(
        children: [
          Container(
            color: Colors.grey[200],
            padding: EdgeInsets.all(16),
            child: Row(
              children: [
                CircleAvatar(
                  backgroundImage: AssetImage(
                    'assets/images/user_photo.jpg'
                  ),
                  radius: 40,
                ),
                SizedBox(width: 16),
                Expanded(
                  child: Column(
                    crossAxisAlignment: CrossAxisAlignment.start,
                    children: [
                      Text(
                        '鲨鱼辣椒',
                        style: TextStyle(
                          fontSize: 20,
                          fontWeight: FontWeight.bold,
                        ),
                      ),
                      Text(
                        '1199799157@qq.com',
                        style: TextStyle(
                          fontSize: 16,
                          color: Colors.grey,
                        ),
                      ),
                    ],
                  ),
                ),
              ],
            ),
          ),
          Expanded(
            child: ListView(
              children: [
                ListTile(
                  leading: Icon(Icons.lock),
                  title: Text('隐私设置'),
                  onTap: () {
                  },
                ),
                ListTile(
                  leading: Icon(Icons.notifications),
                  title: Text('通知设置'),
                  onTap: () {
                  },
                ),
                ListTile(
                  leading: Icon(Icons.info),
                  title: Text('关于'),
                  onTap: () {
                  },
                ),
                ListTile(
                  leading: Icon(Icons.update),
                  title: Text('检查更新'),
                  subtitle: Text('当前版本: 1.0.0'),
                  onTap: () {
                  },
                ),
                ListTile(
                  leading: Icon(Icons.exit_to_app),
                  title: Text('退出登录'),
                  onTap: () {
                    Navigator.of(context).pushAndRemoveUntil(
                      MaterialPageRoute(builder: (context) => FreightSmartLoginPage()),
                      (Route<dynamic> route) => false,
                    );
                  },
                ),
              ],
            ),
          ),
        ],
      );
  }
}